//application settings
//float communicats
var message = {};
message.floats = {};
message.floats.putPoiHint = 'Click on the map to put POI, click on edit button to go to POI form.';
message.floats.poiWasSaved = 'Success, POI was saved';
message.floats.successLogin = 'Success, you are logged in';
message.floats.failLogin = 'Error, wrong username or password (or problem with connection)';
message.floats.successPoiSave = 'Success, POI was saved';
message.floats.failPoiSave = 'Error, POI was not saved';
message.floats.loggingIn = 'Logging in';
message.floats.savingPoi = 'Saving POI';
message.inputs = {};
message.inputs.tagName = 'Tag name';
message.inputs.tagValue = 'Tag value';

var settings = {};
settings.gpsFrequency = 30000; //how often coordinates are read (time, in ms)
settings.appFrequency = 10000; //how often map is refreshed (time, in ms)
settings.loadingFrequency = 1000; //how often loading communicate blinks (time, in ms)

settings.newPoiIcon = 'img/pin_blue.png';
settings.currentLocationIcon = 'img/men.gif';

settings.poiCategories = {};
settings.poiCategories.amusement = {
	name : 'Amusement',
	content : new Array()
};
settings.poiCategories.accomodation = {
		name : 'Accomodation',
		content : new Array()
	};
settings.poiCategories.art = {
	name : 'Art',
	content : new Array()
};
settings.poiCategories.education = {
	name : 'Education',
	content : new Array()
};
settings.poiCategories.food = {
	name : 'Food',
	content : new Array()
};
settings.poiCategories.medicine = {
	name : 'Medicine',
	content : new Array()
};
settings.poiCategories.money = {
	name : 'Money',
	content : new Array()
};
settings.poiCategories.travel = {
	name : 'Travel',
	content : new Array()
};
settings.poiCategories.other = {
	name : 'Other',
	content : new Array()
};

settings.poiIconsFolder = 'img/poiIcons/';

settings.pois = {};
settings.pois.arts_center = {tagKey: 'amenity'};
settings.pois.arts_center.name = 'Art center';
settings.pois.arts_center.icon = 'arts_center.png';
settings.pois.arts_center.tagValue = 'arts_center';
settings.poiCategories.art.content.push(settings.pois.arts_center);

settings.pois.museum = {};
settings.pois.museum.name = 'Museum';
settings.pois.museum.icon = 'museum.png';
settings.pois.museum.tagValue = 'museum';
settings.pois.museum.tagKey = 'tourism'
settings.poiCategories.art.content.push(settings.pois.museum);

settings.pois.atm = {tagKey: 'amenity'};
settings.pois.atm.name = 'ATM';
settings.pois.atm.icon = 'atm.png';
settings.pois.atm.tagValue = 'atm';
settings.poiCategories.money.content.push(settings.pois.atm);

settings.pois.bank = {tagKey: 'amenity'};
settings.pois.bank.name = 'Bank';
settings.pois.bank.icon = 'bank.png';
settings.pois.bank.tagValue = 'bank';
settings.poiCategories.money.content.push(settings.pois.bank);

settings.pois.bar = {tagKey: 'amenity'};
settings.pois.bar.name = 'Bar';
settings.pois.bar.icon = 'bar.png';
settings.pois.bar.tagValue = 'bar';
settings.poiCategories.food.content.push(settings.pois.bar);

settings.pois.bench = {tagKey: 'amenity'};
settings.pois.bench.name = 'Bench';
settings.pois.bench.icon = 'bench.png';
settings.pois.bench.tagValue = 'bench';
settings.poiCategories.other.content.push(settings.pois.bench);

settings.pois.airport = {tagKey: 'amenity'};
settings.pois.airport.name = 'Airport';
settings.pois.airport.icon = 'airport.png';
settings.pois.airport.tagValue = 'airport';
settings.poiCategories.travel.content.push(settings.pois.airport);

settings.pois.bicyle_parking = {tagKey: 'amenity'};
settings.pois.bicyle_parking.name = 'Bicyle parking';
settings.pois.bicyle_parking.icon = 'bicycle_parking.png';
settings.pois.bicyle_parking.tagValue = 'bicyle_parking';
settings.poiCategories.travel.content.push(settings.pois.bicyle_parking);

settings.pois.bus_station = {tagKey: 'amenity'};
settings.pois.bus_station.name = 'Bus station';
settings.pois.bus_station.icon = 'bus_station.png';
settings.pois.bus_station.tagValue = 'bus_station';
settings.poiCategories.travel.content.push(settings.pois.bus_station);

settings.pois.bus_stop = {tagKey: 'highway'};
settings.pois.bus_stop.name = 'Bus stop';
settings.pois.bus_stop.icon = 'bus_station.png';
settings.pois.bus_stop.tagValue = 'bus_stop';
settings.poiCategories.travel.content.push(settings.pois.bus_stop);

settings.pois.cafe = {tagKey: 'amenity'};
settings.pois.cafe.name = 'Cafe';
settings.pois.cafe.icon = 'cafe.png';
settings.pois.cafe.tagValue = 'cafe';
settings.poiCategories.food.content.push(settings.pois.cafe);

settings.pois.car_rental = {tagKey: 'amenity'};
settings.pois.car_rental.name = 'Care rental';
settings.pois.car_rental.icon = 'car_rental.png';
settings.pois.car_rental.tagValue = 'car_rental';
settings.poiCategories.travel.content.push(settings.pois.car_rental);

settings.pois.car_wash = {tagKey: 'amenity'};
settings.pois.car_wash.name = 'Car wash';
settings.pois.car_wash.icon = 'car_wash.png';
settings.pois.car_wash.tagValue = 'car_wash';
settings.poiCategories.other.content.push(settings.pois.car_wash);

settings.pois.cinema = {tagKey: 'amenity'};
settings.pois.cinema.name = 'Cinema';
settings.pois.cinema.icon = 'cinema.png';
settings.pois.cinema.tagValue = 'cinema';
settings.poiCategories.amusement.content.push(settings.pois.cinema);

settings.pois.college = {tagKey: 'amenity'};
settings.pois.college.name = 'College';
settings.pois.college.icon = 'college.png';
settings.pois.college.tagValue = 'college';
settings.poiCategories.education.content.push(settings.pois.college);

settings.pois.community_centre = {tagKey: 'amenity'};
settings.pois.community_centre.name = 'Community centre';
settings.pois.community_centre.icon = 'community_centre.png';
settings.pois.community_centre.tagValue = 'community_centre';
settings.poiCategories.other.content.push(settings.pois.community_centre);

settings.pois.courthouse = {tagKey: 'amenity'};
settings.pois.courthouse.name = 'Courthouse';
settings.pois.courthouse.icon = 'courthouse.png';
settings.pois.courthouse.tagValue = 'courthouse';
settings.poiCategories.other.content.push(settings.pois.courthouse);

settings.pois.dentist = {tagKey: 'amenity'};
settings.pois.dentist.name = 'Dentist';
settings.pois.dentist.icon = 'dentist.png';
settings.pois.dentist.tagValue = 'dentist';
settings.poiCategories.medicine.content.push(settings.pois.dentist);

settings.pois.doctor = {tagKey: 'amenity'};
settings.pois.doctor.name = 'Doctor';
settings.pois.doctor.icon = 'doctor.png';
settings.pois.doctor.tagValue = 'doctor';
settings.poiCategories.medicine.content.push(settings.pois.doctor);

settings.pois.embassy = {tagKey: 'amenity'};
settings.pois.embassy.name = 'Embassy';
settings.pois.embassy.icon = 'embassy.png';
settings.pois.embassy.tagValue = 'embassy';
settings.poiCategories.other.content.push(settings.pois.embassy);

settings.pois.fast_food = {tagKey: 'amenity'};
settings.pois.fast_food.name = 'Fast food';
settings.pois.fast_food.icon = 'fast_food.png';
settings.pois.fast_food.tagValue = 'fast_food';
settings.poiCategories.food.content.push(settings.pois.fast_food);

settings.pois.ferry_terminal = {tagKey: 'amenity'};
settings.pois.ferry_terminal.name = 'Ferry terminal';
settings.pois.ferry_terminal.icon = 'ferry_terminal.png';
settings.pois.ferry_terminal.tagValue = 'ferry_terminal';
settings.poiCategories.travel.content.push(settings.pois.ferry_terminal);

settings.pois.fire_station = {tagKey: 'amenity'};
settings.pois.fire_station.name = 'Fire station';
settings.pois.fire_station.icon = 'fire_station.png';
settings.pois.fire_station.tagValue = 'fire_station';
settings.poiCategories.other.content.push(settings.pois.fire_station);

settings.pois.fountain = {tagKey: 'amenity'};
settings.pois.fountain.name = 'Fountain';
settings.pois.fountain.icon = 'fountain.png';
settings.pois.fountain.tagValue = 'fountain';
settings.poiCategories.other.content.push(settings.pois.fountain);

settings.pois.fuel = {tagKey: 'amenity'};
settings.pois.fuel.name = 'Fuel';
settings.pois.fuel.icon = 'fuel.png';
settings.pois.fuel.tagValue = 'fuel';
settings.poiCategories.travel.content.push(settings.pois.fuel);

settings.pois.hospital = {tagKey: 'amenity'};
settings.pois.hospital.name = 'Hospital';
settings.pois.hospital.icon = 'hospital.png';
settings.pois.hospital.tagValue = 'hospital';
settings.poiCategories.medicine.content.push(settings.pois.hospital);

settings.pois.library = {tagKey: 'amenity'};
settings.pois.library.name = 'Library';
settings.pois.library.icon = 'library.png';
settings.pois.library.tagValue = 'library';
settings.poiCategories.education.content.push(settings.pois.library);

settings.pois.night_club = {tagKey: 'amenity'};
settings.pois.night_club.name = 'Night club';
settings.pois.night_club.icon = 'night_club.png';
settings.pois.night_club.tagValue = 'night_club';
settings.poiCategories.amusement.content.push(settings.pois.night_club);

settings.pois.parking = {tagKey: 'amenity'};
settings.pois.parking.name = 'Parking';
settings.pois.parking.icon = 'parking.png';
settings.pois.parking.tagValue = 'parking';
settings.poiCategories.other.content.push(settings.pois.parking);

settings.pois.place_of_worship = {tagKey: 'amenity'};
settings.pois.place_of_worship.name = 'Place of worship';
settings.pois.place_of_worship.icon = 'place_of_worship.png';
settings.pois.place_of_worship.tagValue = 'place_of_worship';
settings.poiCategories.other.content.push(settings.pois.place_of_worship);

settings.pois.police = {tagKey: 'amenity'};
settings.pois.police.name = 'Police';
settings.pois.police.icon = 'police.png';
settings.pois.police.tagValue = 'police';
settings.poiCategories.other.content.push(settings.pois.police);

settings.pois.post_office = {tagKey: 'amenity'};
settings.pois.post_office.name = 'Post office';
settings.pois.post_office.icon = 'post_office.png';
settings.pois.post_office.tagValue = 'post_office';
settings.poiCategories.other.content.push(settings.pois.post_office);

settings.pois.prison = {tagKey: 'amenity'};
settings.pois.prison.name = 'Prison';
settings.pois.prison.icon = 'prison.png';
settings.pois.prison.tagValue = 'prison';
settings.poiCategories.other.content.push(settings.pois.prison);

settings.pois.pub = {tagKey: 'amenity'};
settings.pois.pub.name = 'Pub';
settings.pois.pub.icon = 'pub.png';
settings.pois.pub.tagValue = 'pub';
settings.poiCategories.food.content.push(settings.pois.pub);

settings.pois.recycling = {tagKey: 'amenity'};
settings.pois.recycling.name = 'Recycling';
settings.pois.recycling.icon = 'recycling.png';
settings.pois.recycling.tagValue = 'recyling';
settings.poiCategories.other.content.push(settings.pois.recycling);

settings.pois.restaurant = {tagKey: 'amenity'};
settings.pois.restaurant.name = 'Restaurant';
settings.pois.restaurant.icon = 'restaurant.png';
settings.pois.restaurant.tagValue = 'restaurant';
settings.poiCategories.food.content.push(settings.pois.restaurant);

settings.pois.sauna = {tagKey: 'amenity'};
settings.pois.sauna.name = 'Sauna';
settings.pois.sauna.icon = 'sauna.png';
settings.pois.sauna.tagValue = 'sauna';
settings.poiCategories.other.content.push(settings.pois.sauna);

settings.pois.school = {tagKey: 'amenity'};
settings.pois.school.name = 'School';
settings.pois.school.icon = 'school.png';
settings.pois.school.tagValue = 'school';
settings.poiCategories.education.content.push(settings.pois.school);

settings.pois.shelter = {tagKey: 'amenity'};
settings.pois.shelter.name = 'Shelter';
settings.pois.shelter.icon = 'shelter.png';
settings.pois.shelter.tagValue = 'shelter';
settings.poiCategories.other.content.push(settings.pois.shelter);

settings.pois.station = {};
settings.pois.station.name = 'Railway station';
settings.pois.station.icon = 'train.png';
settings.pois.station.tagValue = 'station';
settings.pois.station.tagKey = 'railway';
settings.poiCategories.travel.content.push(settings.pois.station);

settings.pois.taxi = {tagKey: 'amenity'};
settings.pois.taxi.name = 'Taxi';
settings.pois.taxi.icon = 'taxi.png';
settings.pois.taxi.tagValue = 'taxi';
settings.poiCategories.travel.content.push(settings.pois.taxi);

settings.pois.telephone = {tagKey: 'amenity'};
settings.pois.telephone.name = 'Telephone';
settings.pois.telephone.icon = 'telephone.png';
settings.pois.telephone.tagValue = 'telephone';
settings.poiCategories.other.content.push(settings.pois.telephone);

settings.pois.theater = {tagKey: 'amenity'};
settings.pois.theater.name = 'Theater';
settings.pois.theater.icon = 'theater.png';
settings.pois.theater.tagValue = 'theater';
settings.poiCategories.amusement.content.push(settings.pois.theater);

settings.pois.toilets = {tagKey: 'amenity'};
settings.pois.toilets.name = 'Toilets';
settings.pois.toilets.icon = 'toilets.png';
settings.pois.toilets.tagValue = 'toilets';
settings.poiCategories.other.content.push(settings.pois.toilets);

settings.pois.university = {tagKey: 'amenity'};
settings.pois.university.name = 'University';
settings.pois.university.icon = 'university.png';
settings.pois.university.tagValue = 'university';
settings.poiCategories.education.content.push(settings.pois.university);

settings.pois.tram_stop = {};
settings.pois.tram_stop.name = 'Tram stop';
settings.pois.tram_stop.icon = 'tram.png';
settings.pois.tram_stop.tagValue = 'tram_stop';
settings.pois.tram_stop.tagKey = 'railway';
settings.poiCategories.travel.content.push(settings.pois.tram_stop);

settings.pois.hotel = {};
settings.pois.hotel.name = 'Hotel';
settings.pois.hotel.icon = 'hotel.png';
settings.pois.hotel.tagValue = 'hotel';
settings.pois.hotel.tagKey = 'tourism';
settings.poiCategories.accomodation.content.push(settings.pois.hotel);

settings.pois.hostel = {};
settings.pois.hostel.name = 'Hostel';
settings.pois.hostel.icon = 'hostel.png';
settings.pois.hostel.tagValue = 'hostel';
settings.pois.hostel.tagKey = 'tourism';
settings.poiCategories.accomodation.content.push(settings.pois.hostel);

settings.pois.camp_site = {};
settings.pois.camp_site.name = 'Camp site';
settings.pois.camp_site.icon = 'campingsite.png';
settings.pois.camp_site.tagValue = 'camp_site';
settings.pois.camp_site.tagKey = 'tourism';
settings.poiCategories.accomodation.content.push(settings.pois.camp_site);

settings.pois.supermarket = {};
settings.pois.supermarket.name = 'Supermarket';
settings.pois.supermarket.icon = 'supermarket.png';
settings.pois.supermarket.tagValue = 'supermarket';
settings.pois.supermarket.tagKey = 'shop';
settings.poiCategories.other.content.push(settings.pois.supermarket);

settings.pois.other = {};
settings.pois.other.name = "Other";
settings.pois.other.icon = 'other.png';
settings.pois.other.tagValue = '';

var server = {};
server.useLocal = false;
if (server.useLocal) {
	server.createChangesetUrl = 'create_changeset.php';
	server.createNodeUrl = 'create_node.php';
	server.updateNodeUrl = 'update_node.php?id=';
	server.getPoisByBBOXUrl = 'get_nodes.php?bbox=';
	server.requestType = 'POST';
} else {
	server.createChangesetUrl = 'http://api.openstreetmap.org/api/0.6/changeset/create';
	server.createNodeUrl = 'http://api.openstreetmap.org/api/0.6/node/create';
	server.updateNodeUrl = 'http://api.openstreetmap.org/api/0.6/node/';
	server.getPoisByBBOXUrl = 'http://api.openstreetmap.org/api/0.6/map?bbox=';
	server.requestType = 'PUT';
}
